package com.ysd.lis.controller.lab;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.HisReqDto;
import com.ysd.lis.request.PrintBarcodeDto;
import com.ysd.lis.service.lab.LabHisReqService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 申请中间表 前端控制器
 * </p>
 *
 * @author HuaiXing
 * @since 2024-01-18
 */
@RestController
@RequestMapping("/lab/hisReq")
public class LabHisReqController extends BaseController {

    @Autowired
    LabHisReqService labHisReqService;

    @ApiOperation("打印条码")
    @PostMapping("/printBarcode")
    public Result printBarcode(@RequestBody HisReqDto dto) {
        return labHisReqService.printBarcode(dto);
    }

    @ApiOperation("查询申请,分管")
    @PostMapping("/barcodePrintSearch")
    public Result barcodePrintSearch(@RequestBody PrintBarcodeDto dto) {
        return labHisReqService.barcodePrintSearch(dto);
    }

    @ApiOperation("打印条码")
    @PostMapping("/barcodePrint")
    public Result barcodePrint(@RequestBody HisReqDto dto) throws JsonProcessingException {
        return labHisReqService.barcodePrint(dto);
    }

    @ApiOperation("查询病人信息")
    @PostMapping("/getPatInfo")
    public Result getPatInfo(@RequestBody PrintBarcodeDto dto) {
        return labHisReqService.getPatInfo(dto);
    }

    @ApiOperation("预制条码")
    @PostMapping("/prefabricateBarcode")
    public Result prefabricateBarcode(@RequestBody PrintBarcodeDto dto) {
        return labHisReqService.prefabricateBarcode(dto);
    }


    @ApiOperation("根据二维码获取身份证号")
    @GetMapping("/getIdCardByBarcode")
    public Result getIdCardByBarcode(String barcode) {
        return labHisReqService.getIdCardByBarcode(barcode);
    }




}
